'use strict';

const Controller = require('egg').Controller;

class HomeController extends Controller {
  async index() {
    const { ctx } = this;
    ctx.body = 'hi, egg';
  }

  async findUser() {
    // 数据库插件使用举例  this.ctx.app.mysql.query
    const { ctx } = this;
    console.log(ctx.service.home.findUser())
    const data = await ctx.service.home.findUser()
    ctx.body = data;
  }
}

module.exports = HomeController;
